/*
 * Copyright (c) 2008-2013 Haulmont. All rights reserved.
 * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
 */

package com.haulmont.asu.web.ui.cathedra;

import com.haulmont.asu.entity.Cathedra;
import com.haulmont.cuba.gui.WindowManager;
import com.haulmont.cuba.gui.components.AbstractEditor;
import com.haulmont.cuba.gui.components.Table;
import com.haulmont.cuba.gui.components.actions.CreateAction;
import com.haulmont.cuba.gui.components.actions.EditAction;

import javax.inject.Inject;
import java.util.Map;

/**
 * Author: Sergey42
 * Date: 14.10.13 13:17
 */
public class CathedraEditor extends AbstractEditor<Cathedra> {

    @Inject
    protected Table consultantsTable;

    @Override
    public void init(Map<String, Object> params) {
        consultantsTable.removeAction(getAction("consultantsTable.create"));
        consultantsTable.addAction(new CreateAction(consultantsTable, WindowManager.OpenType.DIALOG));

        consultantsTable.removeAction(getAction("consultantsTable.edit"));
        consultantsTable.addAction(new EditAction(consultantsTable, WindowManager.OpenType.DIALOG));
    }
}
